package ferp.core.state;

import ferp.core.game.Game;
import ferp.core.game.Input;
import ferp.core.game.Settings;
import ferp.core.player.Profile;

/**
 * User: olegs
 * Date: 25/11/2014 11:36
 */
public class ActorMoving extends State
{
  @Override
  public int process(Game.Listener listener, Profile profile, Game g, Settings settings, Input input) throws Game.Error
  {
    // save the current state
    save(profile);

    g.options.set(Input.Options.WAIT_FOR_CARD_ANIMATION);
    g.set(State.process);

    if (g.mode().showFirstHand(g, settings))
      listener.showFirstHand(g.getFirstHandPlayer());
    else
      listener.hideFirstHand();

    listener.onPlayCard(g, g.current(), g.scenario().card(g.rounds, g.current()));

    return Result.SHOW_OPTIONS;
  }
}
